<template>
  <div>
    <myhead title="新增地址"></myhead>
    <van-address-edit
      :area-list="areaList"
      show-postal
      show-delete
      show-set-default
      show-search-result
      :search-result="searchResult"
      :area-columns-placeholder="['请选择', '请选择', '请选择']"
      @save="onSave"
      @delete="onDelete"
    />
  </div>
</template>
<script>
import {areaList} from './address.js'
export default {
   data() {
    return {
      areaList,
      searchResult: [],
    };
  },
  methods: {
    onSave(value) {
      this.$ajax.addsite({
          name:value.name,
          tel:value.tel,
          phone:this.userInfo.phone,
          address:value.city+value.county+value.addressDetail,
          isDefault:value.isDefault
      }).then(res=>{
        console.log(res)
      })
     this.$toast('地址新增成功');
    },
    onDelete() {
      Toast('delete');
    },
  },
};
</script>